package com.sjx.onelinecord.ui

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager
import com.sjx.onelinecord.R

class TabViewPagerAty : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_tab_view_pager_aty)
        val viewPager = findViewById<ViewPager>(R.id.tabViewPager)
        viewPager.adapter = object : FragmentPagerAdapter(supportFragmentManager) {
            override fun getItem(position: Int): Fragment {
                return TestFragment.newInstance(position)
            }

            override fun getCount(): Int {
                return 3
            }
        }
    }
}